home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 03 - 1987 / 03.04 Apr 87 / MPW macros / C_Macros next >
Encoding:
Text File  |  1986-12-05  |  1.0 KB  |  47 lines  |  [TEXT/MPS ]

  1. set ask "request 'Structure Level:' "
  2. export ask
  3.  
  4. AddMenu C 'top/1' 'find • "{active}"'
  5. AddMenu C 'bottom/2' 'find ∞ "{active}"'
  6. AddMenu C '(-' ''
  7.  
  8. AddMenu C 'for/4' ∂
  9. 'begin;∂
  10.    set lvl `{ask}`;∂
  11.    echo "for (x;;)∂n  ∂{ ∂n  ∂}";∂
  12.    adjust -l `evaluate {lvl} * {tab}` \∂{\:/∂}/ "{active}";∂
  13.    cut !1 "{active}";∂
  14.    find \x\ "{active}";∂
  15.  end'
  16.  
  17. AddMenu C 'if/I' ∂
  18. 'begin;∂
  19.    set lvl `{ask}`;∂
  20.    echo "if (x)∂n  ∂{ ∂n  ∂}";∂
  21.    adjust -l `evaluate {lvl} * {tab}` \∂{\:/∂}/ "{active}";∂
  22.    cut !1 "{active}";∂
  23.    find \x\ "{active}";∂
  24.  end'
  25.  
  26. AddMenu C 'if_else/E' ∂
  27. 'begin;∂
  28.     set lvl `{ask}`;∂
  29.     set t `evaluate {lvl} * {tab}`;∂
  30.     echo "if (x)∂n  ∂{ ∂n  ∂}∂nelse∂n  ∂{ ∂n  ∂}";∂
  31.     find \x\ "{active}";∂
  32.     adjust -l {t} /∂{/:/else/ "{active}";∂
  33.     adjust -l {t} /∂{/:/∂}/ "{active}";∂
  34.     cut !1 "{active}";∂
  35.     find \x\ "{active}";∂
  36.  end'
  37.  
  38. AddMenu C 'while' ∂
  39. 'begin;∂
  40.     set lvl `{ask}`;∂
  41.     echo "while (x)∂n  ∂{ ∂n  ∂}";∂
  42.     find \∂}\ "{active}"; cut !1 "{active}";∂
  43.     find \x\ "{active}";∂
  44.     adjust -l `evaluate {lvl} * {tab}` /∂{/:/∂}/ "{active}";∂
  45.     find \x\ "{active}";∂
  46.  end'
  47.